<?php

namespace app\common\model;

use think\Model;

class UserDevice extends Model
{
    //
    static function bindUserDevice($user_id,$device_id){
        $data = [
            "user_id"=>$user_id,
            "device_id"=>$device_id
        ];
        $me= new self();
        $exist = $me->where($data)->find();
        if(!$exist){
            $exist = $me->insert($data);
        }
        return $exist;
    }
}
